<template>
  <div class="clickBox_container">
    <div class="clickBox_wrapper">
      <div class="clickBox" v-for="item in data" :key="item.id" @click="todetails(item.id)">
        <img :src="item.pic" />
        <h6>{{ item.name }}</h6>
        <p>{{ item.characteristic }}</p>
        <span>￥ {{ item.originalPrice }} </span>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    data: {
      type: Array,
    },
  },
 
  methods: {
    todetails(id){   
      // console.log(id);
    this.$router.pushRouteByQuery("/datalist",{id:id})
    }
  },
};
</script>

<style lang="scss" scoped>
.clickBox_container {
  width: 100%;
}
.clickBox_wrapper {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  font-size: 16px;
}
h6 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
}
.clickBox {
  width: 50%;
  p {
    width: 100%;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    overflow: hidden;
  }
  img {
    width: 100%;
    height: 10rem;
  }
  span{
    color: red;
  }
}
</style>